package de.servicezombie.spring;

import java.util.Properties;

import org.springframework.beans.factory.FactoryBean;

import de.servicezombie.lang.ToProperties;

/**
 * converts a properties based configuration file to a real 
 * properties object
 * @author ChKa
 *
 */
public class PropertiesFromConfigurationFactoryBean implements FactoryBean<Properties> {

	private ToProperties properties;
	
	public void setProperties(ToProperties properties) {
		this.properties = properties;
	}
	
	@Override
	public Properties getObject() throws Exception {
		return properties.toProperties();
	}

	@Override
	public Class<?> getObjectType() {
		return Properties.class;
	}

	@Override
	public boolean isSingleton() {
		return true;
	}
	
	

}
